<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Location extends MY_Controller {
    
    public function __construct() {
        parent:: __construct();
        $this->load->helper("url");
        $this->load->library("form_validation");
    }

    public function get_state() {
        $cityId = $this->input->post("city_id");
        $this->load->helper('registration');
        $json = array();
        $json['status'] = true;
        $json['data'] = buildStateDropdown('state', '', $cityId);
        echo json_encode($json);
        exit();
    }
    
    public function get_ward() {
        $stateId = $this->input->post("state_id");
        $this->load->helper('registration');
        $json = array();
        $json['status'] = true;
        $json['data'] = buildWardDropdown('ward', '', $stateId);
        echo json_encode($json);
        exit();
    }

}